﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
namespace SQT.tracnghiem.Ajax.ASP.Accountant
{
    public partial class load_Chart : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public bool check_Late(DateTime t)
        {
            int ca = 0;
            bool late = false;
            if (t.Hour >= 0 && t.Hour <= 12)
            {
                ca = 1;
            }
            if (t.Hour >= 13 && t.Hour <= 16)
            {
                ca = 2;
            }
            if (t.Hour >= 17 && t.Hour <= 24)
            {
                ca = 3;
            }
            if (ca == 1)
            {
                if (t.Hour > 8)
                    late = true;
                if (t.Hour == 8 && t.Minute > 30)
                    late = true;
            }
            if (ca == 2)
            {
                if (t.Hour > 13)
                    late = true;
            }
            if (ca == 3)
            {
                if (t.Hour > 17)
                    late = true;
                if (t.Hour == 17 && t.Minute > 30)
                    late = true;
            }
            return late;
        }
    }
}